import unittest
import sys
sys.path.append(r'D:\NetWork\micro-member-ui-automation')

# 导入包
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from ddt import ddt,unpack,file_data
from util.Draw import LuckDraw
from util.StoredManage import StoredManage
from util.untitled2 import Login
from util.untitled2 import IntoMerchant
from selenium.common import exceptions
import yaml

chrome_options=Options()
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")
chrome_driver=r'C:\Users\Administrator\AppData\Local\Programs\Python\Python39\chromedriver.exe'
driver=webdriver.Chrome(chrome_driver,chrome_options=chrome_options)

@ddt
class testcase(Login,StoredManage,IntoMerchant,unittest.TestCase):
    # @file_data(r'./data/DrawEachAward.yaml')
    # @unpack
    # def case01(self,**kwargs):
    #     self.Login = Login()
    #     self.Login.denglu()

    #     self.IntoMerchant=IntoMerchant()
    #     self.IntoMerchant.into()
    #     handles = driver.window_handles  
    #     driver.switch_to.window(handles[-1])
    #     self.LuckDraw = LuckDraw(driver)
    #     self.LuckDraw.ClickLuckyDraw('抽奖活动')
    #     self.LuckDraw.SweepStakesNewDraw()
    #     self.LuckDraw.CouponsOrIntegralOrStored()
    #     self.LuckDraw.EachAward(**kwargs)
    
    def case02(self):
        # self.Login = Login()
        # self.Login.denglu()
        self.IntoMerchant=IntoMerchant()
        self.IntoMerchant.into()
        handles = driver.window_handles  
        driver.switch_to.window(handles[-1])
        self.StoredManage = StoredManage(driver)
        self.StoredManage.StoredManage('充值方案管理')
        self.StoredManage.Topupmanage()
        self.StoredManage.TopupOptions()
        self.StoredManage.AwardFilIn()


case1= testcase(driver)
case1.case02()